<template>
  <div class="type_top">
      <div class="type_title">
          <router-link to="/tide"><van-icon name="arrow-left"/></router-link>
          <h3>夏日派对一起开party！</h3>
      </div>
      <div class="img_box">
          <img src="/tide/fashion_swiper/1.jpg">
      </div>
      <div class="type_sort">
          <p @click="color(0)" class="active_color">综合</p>
          <p @click="color(1)" class="normal_color">新品</p>
          <p @click="color(2)" class="normal_color">销量</p>
          <p @click="color(3)" class="normal_color">价格</p>
      </div>
  </div>
</template>

<script>
export default {
    methods:{
        color(index){
            let arr = document.querySelectorAll("p");
            for(let i=0;i<arr.length;i++){
                arr[i].className = "normal_color";
            }
            arr[index].className = "active_color"

            
        }
    }
}
</script>

<style scoped>
    .type_top{
        width: 95%;
        margin: auto;
    }
    .type_top .type_title{
        width: 100%;
        height: 0.38rem;
        line-height: 0.38rem;
        /* background-color: cadetblue; */
        position: relative;
        text-align: center;

    }
    .van-icon{
        width: 0.2rem;
        height: 0.2rem;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        margin: auto;
    }
    .type_top .type_title h3{
        font-size: 0.16rem;
        font-weight: normal;
    }
    .type_top .img_box{
        width: 100%;
        height: 1.7rem;
        /* background-color: cornflowerblue; */
        border-radius: 0.07rem;
        overflow: hidden;
    }
    .type_top .img_box img{
        width: 100%;
    }
    .type_top .type_sort{
        width: 100%;
        height: 0.5rem;
        display: flex;
        justify-content: space-around;
        align-items: center;
        /* background-color: darkgray; */
    }
    .type_top .type_sort p{
        
        font-size: 0.16rem;
    }
    .normal_color{
        color:#5b5c5c;
    }
    .active_color{
        color: #ee6b2e;
    }
</style>